﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T12OOP
{
    class Contact
    {
        private string name;
        private string homePhone;
        private string mobilePhone;
        private string busiPhone;
        private string fax;

        public string Name
        {
            get { return name; }

        }
        public string this[string type]
        {
            get
            {
                switch (type)
                {
                    case "mobile": return mobilePhone;
                    case "home": return homePhone;
                    case "business": return busiPhone;
                    case "fax": return fax;
                    default: return "none";
                }

                }
                set{
                    switch (type)
                    {
                        case "mobile":  mobilePhone=value;break;
                        case "home":  homePhone = value; break;
                        case "business":  busiPhone = value; break;
                        case "fax":  fax = value; break;
                    }
            }
        }
    }
}
